package com.neo.office.server.utils;

import com.neo.office.server.domain.entity.User;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * 用户工具类
 */
public class UserUtils {

    /**
     * 获取当前登录用户
     * @return
     */
    public static User getCurrentUser(){
        return (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    }
}
